const initialState = {
    productList: [],
    remark: '',
    selectedAddress: null,
    selectedCoupon: null,
};

export default (state = initialState, action) => {
    const newState = {...state};
    switch (action.type) {
        case 'place-order': {
            newState.productList = action.payload;
            return newState;
        }
        case 'order-selectedAddress-save': {
            newState.selectedAddress = action.payload;
            return newState;
        }
        case 'order-selectedCoupon-save': {
            newState.selectedCoupon = action.payload;
            return newState;
        }
        case 'order-remark-save': {
            newState.remark = action.payload;
            return newState;
        }
        default:
            console.log('order');
            return newState
    }
}
